package com.yanqu.road.server.cmd.activity.chuhan.cross;

import com.yanqu.road.entity.enums.eGamePlayerEventType;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.pb.activity.ChuHanProto;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.command.Command;
import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.server.gameplayer.module.activity.ActivityModule;
import com.yanqu.road.server.manger.player.GamePlayerMgr;
import com.yanqu.road.server.protocol.GameProtocol;
import io.netty.channel.ChannelHandlerContext;

@Cmd(code = GameProtocol.S_CHUHAN_SYNC_ORDER_CITY_TASK_FROM_CROSS, desc = "")
public class ChuHanSyncOrderCityTaskFromCrossCmd implements Command {

    @Override
    public void execute(ChannelHandlerContext ctx, YanQuMessage packet) throws Exception {
        ChuHanProto.ChuHanOrderCityTaskSyncMsg syncMsg = ChuHanProto.ChuHanOrderCityTaskSyncMsg.parseFrom(packet.getBytes());
        GamePlayer onlinePlayer = GamePlayerMgr.getOnlinePlayer(packet.getPlayerId());
        if (onlinePlayer != null) {
            onlinePlayer.notifyListener(eGamePlayerEventType.ChuHanDailyOccupyCity.getValue(), syncMsg);
        }
    }

}
